package com.office.anywher.infopub;

import java.util.HashMap;
import java.util.List;

import org.json.JSONException;

import com.office.anywher.https.HttpClientService;
import com.office.anywher.poly.list.Common;
import com.office.anywher.poly.list.IDataReceiveForList;

public class NoticeReceiver extends Common implements IDataReceiveForList{

	@Override
	public List<HashMap<String, Object>> receive(HttpClientService aService,
			int start, int rowNum) throws Exception {
		return null;
	}
	
	public String[][] receiveNoticeType(HttpClientService aService) throws JSONException{
		String[][] aReturn = null;
		/*JSONArray aJsonArray = aService.getNoticeType(IConst.Http.Notice.NoticeType.URL, null);
		if(aJsonArray==null || aJsonArray.length()<=0)return null;
		aReturn = new String[aJsonArray.length()][2];
		for(int i=0;i<aJsonArray.length();i++){
			JSONObject aJsonObj = aJsonArray.getJSONObject(i);
			if(isNullInJsonObject(aJsonObj, IConst.Http.Notice.NoticeType.OUT.CODE)) continue;
			aReturn[i][0] = aJsonObj.getString(IConst.Http.Notice.NoticeType.OUT.CODE);
			aReturn[i][1] = isNullInJsonObject(aJsonObj,
					IConst.Http.Notice.NoticeType.OUT.NAME) ? aJsonObj
					.getString(IConst.Http.Notice.NoticeType.OUT.CODE)
					: aJsonObj
							.getString(IConst.Http.Notice.NoticeType.OUT.NAME);
		}*/
		return aReturn;
	}
	/*
	 * IConst.Http.Notice.OUT.ITEM_IMAGE,
						IConst.Http.Notice.OUT.PUBLISHER,
						IConst.Http.Notice.OUT.PUBLISH_DATE,
						IConst.Http.Notice.OUT.CALL_NAME 
	 */
	
	public List<HashMap<String, Object>> receiveNotices(HttpClientService aService,String noticeType,
			int start, int rowNum) throws Exception {/*
		List<HashMap<String, Object>> aReturn = new ArrayList<HashMap<String, Object>>();
		JSONArray aJsonArray = aService.getNoticeTypeList(IConst.Http.Notice.URL,null,noticeType,start,rowNum);
		if(aJsonArray==null || aJsonArray.length()<=0)return null;
		for(int i=0;i<aJsonArray.length();i++){
			JSONObject aJsonObj = aJsonArray.getJSONObject(i);
			if(aJsonObj==null) continue;
			if(isNullInJsonObject(aJsonObj,IConst.Http.Notice.OUT.NOTICE_ID))continue;
			HashMap<String, Object> map = new HashMap<String, Object>();
			map.put(IConst.Http.Notice.OUT.ITEM_IMAGE, R.drawable.pub_info_list_log);
			map.put(IConst.Http.Notice.OUT.PUBLISHER, isNullInJsonObject(aJsonObj,IConst.Http.Notice.OUT.PUBLISHER)?"":aJsonObj.getString(IConst.Http.Notice.OUT.PUBLISHER));
			map.put(IConst.Http.Notice.OUT.PUBLISH_DATE, isNullInJsonObject(aJsonObj,IConst.Http.Notice.OUT.PUBLISH_DATE)?"":aJsonObj.getString(IConst.Http.Notice.OUT.PUBLISH_DATE));
			map.put(IConst.Http.Notice.OUT.CALL_NAME, isNullInJsonObject(aJsonObj,IConst.Http.Notice.OUT.CALL_NAME)?"":aJsonObj.getString(IConst.Http.Notice.OUT.CALL_NAME));
			map.put(IConst.Http.Notice.OUT.NOTICE_ID, isNullInJsonObject(aJsonObj,IConst.Http.Notice.OUT.NOTICE_ID)?"":aJsonObj.getString(IConst.Http.Notice.OUT.NOTICE_ID));
			aReturn.add(map);
		}
		return aReturn;
	*/
		return null;
		}

}
